package net.wangxl.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

@Configuration
public class SpringJdbcTemplateConfig {

    @Bean("jdbcTemplate1")
    public JdbcTemplate get(@Qualifier("dataSource1") DataSource datasource){
        JdbcTemplate jdbcTemplate  = new JdbcTemplate();
        jdbcTemplate.setDataSource(datasource);
        return jdbcTemplate;
    }
}
